<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
        <span aria-hidden="true">&times;</span></button>
    <h4 class="modal-title">培训经历</h4>
</div>
<div class="modal-body">
    <table class="detailTable table table-hover table-striped table-bordered">
        <c:if test="${leaderCheck.operateType==2}">
            <tr>
                <th></th>
                <th>原数据</th>
                <th>新数据</th>
            </tr>
        </c:if>
        <tr>
            <th>
                开始时间：
            </th>
            <td><fmt:formatDate value="${data.startTime}" pattern="yyyy-MM-dd"/></td>
            <c:if test="${leaderCheck.operateType==2}">
                <td ><fmt:formatDate value="${newData.startTime}" pattern="yyyy-MM-dd"/></td>
            </c:if>
        </tr>
        <tr>
            <th>
                结束时间：
            </th>
            <td><fmt:formatDate value="${data.endTime}" pattern="yyyy-MM-dd"/></td>
            <c:if test="${leaderCheck.operateType==2}">
                <td><fmt:formatDate value="${newData.endTime}" pattern="yyyy-MM-dd"/></td>
            </c:if>
        </tr>
        <tr>
            <th>
                培训名称：
            </th>
            <td>${data.name}</td>
            <c:if test="${leaderCheck.operateType==2}">
                <td>${newData.name}</td>
            </c:if>
        </tr>
        <tr>
            <th>
                培训地址：
            </th>
            <td>${data.address}</td>
            <c:if test="${leaderCheck.operateType==2}">
                <td>${newData.address}</td>
            </c:if>
        </tr>
        <tr>
            <th>
                签到情况：
            </th>
            <td>
                <c:choose>
                    <c:when test="${data.signState==0}">未到</c:when>
                    <c:when test="${data.signState==1}">到</c:when>
                </c:choose>
            </td>
            <c:if test="${leaderCheck.operateType==2}">
                <td>
                    <c:choose>
                        <c:when test="${newData.signState==0}">未到</c:when>
                        <c:when test="${newData.signState==1}">到</c:when>
                    </c:choose>
                </td>
            </c:if>
        </tr>
        <tr>
            <th>
                请假事由：
            </th>
            <td>${data.reason}</td>
            <c:if test="${leaderCheck.operateType==2}">
                <td>${newData.reason}</td>
            </c:if>
        </tr>
    </table>
</div>
<script>
    $.each($(".detailTable tr"), function (i, v) {
        var tds=  $(this).find("td");
        if (tds.length==2&&tds[0].innerText.trim()!=tds[1].innerText.trim()){
            $(this).find("td").css("color","red");
        }
    })
</script>